//导入
import request from './request'
import qs from 'qs'

// 首页轮播数接口
export const GetBannerApi = () => request.get('/banner')
// export const GetBannerApi = () => request.get('/banner')

// 热门推荐接口
export const GetHotApi = () => request.get('/personalized?limit=8')


// 新碟上架接口
export const GetNewApi = () => request.get('/album/newest')


// 获取歌单详情 /playlist/detail?id=
export const GetPlayList = (id, cookie) => request({ url: `/playlist/detail?id=${id}&cookie=${cookie}`, method: 'GET' });

// 获取所有榜单 /toplist
export const GetTopList = () => request({ url: '/toplist', method: 'GET' });

// 获取歌单所有歌曲 /playlist/track/all?id=
export const GetAllList = (id) => request({ url: `/playlist/track/all?id=${id}`, method: 'GET' });

// 获取用户歌单
export const GetUserPlayList = (uid, cookie) => request({
    url: `/user/playlist?uid=${uid}&cookie=${cookie}`, method: 'GET' })

// 获取歌曲详情 /song/detail?ids=
export const GetSong = (ids, cookie) => request({ url: `/song/detail?ids=${ids}&cookie=${cookie}`, method: 'GET' });

// 获取音乐 url/song/url?id=
export const GetSongUrl = (parmes) => request.post(`/song/url/v1`,qs.stringify(parmes) );

// 音乐是否可用/check/music?id=33894312
export const GetSongUrlUse = (id) => request({ url: `/check/music?id=${id}`, method: 'GET' });

// 获取歌单评论 /comment/playlist?id=705123491
export const GetCommentPlayList = (id, limit = 20, offset = 0, cookie) => request({ url: `/comment/playlist?id=${id}&limit=${limit}&offset=${offset}&cookie=${cookie}`, method: 'GET' });

//获取歌单接口  /top/playlist

export const GetPlaylists = (limit = 35) => request.get(`/top/playlist/highquality?limit=${limit}`)

// 登录接口
export const GetLoginApi = (params) => request.post('/login/cellphone', qs.stringify(params))

// 发送验证码接口
export const SendCodeApi = (params) => request.post('/captcha/sent', qs.stringify(params))

// 验证验证码
export const GetYzCodeApi = (params) => request.post('/captcha/verify', qs.stringify(params))

//二维码生成的key值接口
export const GetErweimaApi = () => request.get('/login/qr/key')
//传入key生成图片的二维码
export const GetErweimatuApi = (parmes) => request.post("/login/qr/create", qs.stringify(parmes))


//播放音乐 /song/url/v1
export const BofangApi = (parmes) => request.post('/song/url/v1', qs.stringify(parmes))


// 推荐节目接口 /program/recommend
export const GetRecommend = () => request.get("/program/recommend")

// 节目排行榜接口/dj/program/toplist?limit=1
export const GetProgramList = () => request.get("/dj/program/toplist?limit=10")

// 推荐接口 /dj/recommend
export const GetMusicRecommendation = () => request.get("/dj/hot?limit=4")


// 入驻歌手接口/top/artists?offset=0&limit=30
export const GetRuzhuSinger = () => request.get("/top/artists?offset=0&limit=10")

// 歌手接口/artist/list?type=1&area=96&initial=b /artist/list?type=2&area=2&initial=b
export const GetSingerList = () => request.get("/top/artists?offset=0&limit=90")



// 热门新碟接口/top/album
export const GetNewCD = () => request.get("/top/album?offset=0&limit=1&year=2023&month=1")

// 全部新碟接口/album/new?area=KR&limit=35
export const GetAllNewCD = () => request.get("/album/new?area=All&limit=35")

//搜索
export const GetSearchApi = (parmes) => request.post('/search', qs.stringify(parmes))